package icom.acm.action;
import icom.acm.bean.VIEW_USER_USERRELATION;
import icom.acm.manager.View_User_UserRelationMgr;
import icom.acm.util.json.JSONMsg;
import icom.acm.util.json.Json;

import java.util.List;

public class VUserRelationAction extends Action {
	VIEW_USER_USERRELATION vuur;
	
	/**
	 * 输出用户排序列表
	 */
	public void ranking(){
		JSONMsg jmsg = null;
		/*T_USER u = this.checkUser();
		if (u==null){
			jmsg = new JSONMsg(false, "用户未登录!");
			printCode(jmsg.toString());
			return ;
		}*/
		Integer begin = 0;
		Integer end = 7;
		try{
			begin = Integer.parseInt(request.getParameter("begin"));
			end = Integer.parseInt( request.getParameter("end"));
		} catch (Exception ex){
			//jmsg = new JSONMsg(false, "参数传递错误!");
			//printCode(jmsg.toString());
			ex.printStackTrace();
		}finally{}
		
		View_User_UserRelationMgr vuurmgr = new View_User_UserRelationMgr();
		List<VIEW_USER_USERRELATION> list = vuurmgr.select(begin, end, "VUUR_UED_CNT DESC, VUUR_U_ID");		// 得到关注度最高的前8位
		Json json = new Json();
		jmsg = new JSONMsg(true, "");
		jmsg.include(json.toJsons(list));		
		printCode(jmsg.toString());				
	}
	public VIEW_USER_USERRELATION getVuur() {
		return vuur;
	}
	public void setVuur(VIEW_USER_USERRELATION vuur) {
		this.vuur = vuur;
	}
}
